package ru.gr.alphaversion;

import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.view.Gravity;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

class MyView extends LinearLayout {
    ImageView iv;
    TextView tv;
    public MyView(Context c, int drawable, int drawableselec, String label) {
     super(c);
    
     tv = new TextView(c);
     tv.setText(label);
     
     tv.setGravity(Gravity.CENTER);
     tv.setBackgroundColor(Color.TRANSPARENT);
     tv.setTextColor(Color.WHITE);
     tv.setTextSize(14);
     
     tv.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
       LayoutParams.WRAP_CONTENT, (float) 1.0));
     setOrientation(LinearLayout.VERTICAL);
     Drawable d = getResources().getDrawable(drawableselec);
     tv.setBackgroundDrawable(d);
     
      addView(tv);
   
    }
   }